package com.cqhfan.userservice.controller;

import com.cqhfan.userservice.service.FollowService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 眭传洪
 * @create 2025-08-02 1:55
 */
@RestController
@RequestMapping("/follow")
@RequiredArgsConstructor
public class FollowController {

    private final FollowService followService;

    @PostMapping("/addOrRemoveFollowInfo/{followUserId}")
    public void addOrRemoveFollowInfo(@PathVariable("followUserId") Long followUserId) {
        followService.addOrRemoveFollowInfo(followUserId);
    }

    /**
     * 我的关注用户ids(feign专用)
     */
    @GetMapping("/listByUserId/{userId}")
    public List<Long> listByUserId(@PathVariable("userId") Long userId) {
        return followService.listByUserId(userId);
    }

    /**
     * 我的朋友用户ids 你关注了我，我也关注了你(feign专用)
     */
    @GetMapping("/listFriend/{userId}")
    public List<Long> listFriend(@PathVariable("userId") Long userId) {
        return followService.listFriend(userId);
    }

}
